from scipy.signal import stft, istft
# 假设X是频谱数据
nperseg = 1024
w = np.blackman(nperseg)  # 使用汉明窗
X_stft = stft(some_signal, nperseg=nperseg, window=w)
reconstructed_signal = istft(X_stft, nperseg=nperseg, window=w)